package com.china.produce.controller;

import com.china.produce.factorys.audio.AudioRequestFactory;
import com.china.produce.service.audio.AudioService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName
 * @Author niujie
 * @Version
 * @Description
 * @CreateTime 2023/6/17
 */
@RequestMapping("/audio")
@RestController
@Slf4j
public class AudioController {

    @Autowired
    private AudioService audioService;

    @PostMapping("/factory/{type}")
    public String audioFactory(@PathVariable("type") String type) {

        AudioRequestFactory audioRequestFactory = audioService.getAudioRequestFactoryBeanByType(type);

        return audioRequestFactory.getChannelId();
    }
}
